//
//  parse_rdf.h
//  cobalt
//
//  Created by Nicolas Godbout on 2013-08-19.
//  Copyright (c) 2013 Nicolas Godbout. All rights reserved.
//

#ifndef __cobalt__parse_rdf__
#define __cobalt__parse_rdf__

#include "bytestring.h"
#include "environment.h"

using namespace rdf;

struct PState {
    ByteString*     input;
    Environment* env;
};

Triple*
nt_triple(PState* st);

RDFNode
ttl_subject (PState* st);

RDFNode
ttl_predicate (PState* st);

RDFNode
ttl_object (PState* st);

RDFNode
ttl_resource (PState* st);

RDFNode
ttl_blank (PState* st);

RDFNode
ttl_literal (PState* st);

ByteString
ttl_ws (ByteString*);

bool
ttl_eat_ws(ByteString*);

bool
nt_eat_hws(ByteString*);

ByteString
ttl_URIRef (ByteString*);

ByteString
ttl_Blank (ByteString*);

ByteString
ttl_String (ByteString*);

ByteString
ttl_Boolean (ByteString* input);

ByteString
ttl_Integer (ByteString*);

int test_parse_ttl();

#endif /* defined(__cobalt__parse_rdf__) */
